<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<?php
$server = "localhost";
$uname = "root";
$umm = "root";
$db = "maxik";
$con = mysqli_connect($server, $uname, $umm, $db);
if ($con) {
    $id = $_GET['id'];
    $k_uqur = 'select * from table2  where id=' . $id;
    $ok_uqur = mysqli_query($con, $k_uqur);

    if ($ok_uqur && mysqli_num_rows($ok_uqur)) {
        $kur = mysqli_fetch_assoc($ok_uqur);
    }

} else {
    echo 'kaqrug' . mysqli_connect_error();
}a
?>



<form action="04.php" method="POST">
    <input type="hidden" name="id" value="<?php echo $id ?? '0' ?>">
    isim: <input type="text" name="name" value="<?php echo $kur['isim']; ?>">
    yax: <input type="text" name="yax" value="<?php echo $kur['age']; ?>">
    TEL: <input type="text" name="til" value="<?php echo $kur['til']; ?>">
    ads: <input type="text" name="ads" value="<?php echo $kur['ads']; ?>">

    kaspi: <select name="kasip">
<?php

$kaspi_arr = explode(";", $kur['kaspi']);

echo $kaspi_arr;

?>
        <option <? echo $kur['kaspi']=="1"?'selected':'' ?>  value="1">HTML</option>
        <option <? echo $kur['kaspi']=="2"?'selected':'' ?>  value="2">CSS</option>
        <option <? echo $kur['kaspi']=="3"?'selected':'' ?>  value="3">PHP</option>
        <option <? echo $kur['kaspi']=="4"?'selected':'' ?>   value="4">JAVA_scrpit</option>
        <option <? echo $kur['kaspi']=="5"?'selected':'' ?>  value="5">小程序</option>
    </select><br>
    jinsi:

    ogul: <input type="radio" name="jinis" <?php echo($kur['sex'] == 1 ? "checked" : ''); ?> value="1">
    kiz: <input type="radio" name="jinis" <?php echo($kur['sex'] == 2 ? "checked" : ''); ?> value="2">
    <br>
    <?php
    $arr = explode(";", $kur['kizkix']);

    ?>
    <br> kizkix :

    top: <input type="checkbox" name="kop[]" <?php echo (in_array(1, $arr) ? "checked" : '') ; ?> value="1">
    oyun :<input type="checkbox" name="kop[]" <?php echo (in_array(2, $arr) ? "checked" : '') ; ?> value="2">
    kitap : <input type="checkbox" name="kop[]" <?php echo (in_array(3, $arr) ? "checked" : '') ; ?> value="3">
    hanyu : <input type="checkbox" name="kop[]" <?php echo (in_array(4, $arr) ? "checked" : '') ; ?> value="4">

    <br> <input type="submit">


</form>
<scrpit></scrpit>

</body>
</html>